<template>
  <div>
    <div class="top_nav">
      <van-icon
        class="return_icon"
        name="arrow-left"
        @click="returnTap"
      />
      <span class="nav_title">{{ text }}</span>
      <van-icon @click="chakanTap" name="eye-o" style="font-size: 22px" />
    </div>
    <div class="top_pulish">
      <img
        src="../../../assets/images/bianji.png"
        alt=""
        class="camere_icon"
        @click="showpublish"
      />
      <img
        src="../../../../static/images/me/headimg.png"
        alt=""
        class="headimg"
        @click="skiptomylife"
      />
      <span class="name">我的世界</span>
    </div>
    <div class="concent">
      <div class="top_main">
        <img
          src="../../../../static/images/me/headimg.png"
          class="main_headimg"
          alt=""
        />
        <div class="main_name_title">
          <div class="main_name">小李</div>
          <div class="main_title">今天天气真好!</div>
        </div>
      </div>
      <div class="main">
        <div class="main_pictures" @click="skips">
          <div v-for="(item, index) in picList" :key="index">
            <img
              src="../../../../static/images/me/headimg.png"
              class="main_pictures_lattice"
              alt="" 
            />
          </div>
        </div>
        <span class="main_adderss">昌江黎族自治区，昌江县</span>
        <div class="main_time_moreevent">
          <span class="main_time">2020年8月20日 9:00</span>
          <img
            src="../../../../static/images/me/moredot.png"
            alt=""
            class="main_moredot" @click="showpicIcon"
          />
           <div  v-if="isshowpicIcon" class="pic_icon">
          
            <van-icon name="like-o" color="#fff" />
            <span class="mag_10">赞</span>
            <div class="low"></div>
            <van-icon name="other-pay" color="#fff"/>
            <span class="mag_10">评论</span>
             </div>
        </div>
        <div class="comment">
          <div class="bulge"></div>
          <div class="comment_live">
            <img
              src="../../../../static/images/me/live_icon.png"
              alt=""
              class="live_icon"
            />
            <span v-for="item in 3" style="color: #4a5977"> 小李，</span>
          </div>
          <div
            class="comment_chat"
            v-for="(item, index) in 3"
            :key="index"
            @click="show1 = true"
          >
            <div class="comment_main">
              <div class="comment_name_time">
                <span class="comment_name"
                  >小李
                  <span style="color: red">已完成</span>
                </span>
                <span class="comment_time">8月12日 1:20</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <bottomList
      v-if="isshowpublish"
      @closemodal="closemodal"
      @skiptopublish="skiptopublish"
    ></bottomList>
    <van-popup v-model="show" position="bottom">
      <van-datetime-picker
        v-model="currentDate"
        type="year-month"
        title="选择发布时间"
        :min-date="minDate"
        :max-date="maxDate"
        :formatter="formatter"
        @confirm="confirm"
        @cancel="cancel"
      />
    </van-popup>
    <van-overlay
      :show="show1"
      @click="show1 = false"
      style="background: rgba(30, 30, 30, 0.5)"
    >
      <div class="wrapper" @click.stop>
        <div class="block">
          <div class="blockOne block1">删除</div>
          <div class="blockOne" @click="show1 = false">取消</div>
        </div>
      </div>
    </van-overlay>
  </div>
</template>
<script>
import bottomList from "@/components/bottomList.vue";
export default {
  components: {
    bottomList,
  },
  data() {
    return {
      isshowpicIcon:false,
      picList: 6,
      isshowpublish: false,
      show: false,
      minDate: new Date(2020, 0, 1),
      maxDate: new Date(2025, 10, 1),
      currentDate: new Date(),
      show1: false,
      text: "",
    };
  },
  methods: {
    skips(){
this.$router.push({path:"/detailsdes"})
    },
     showpicIcon(){
            this.isshowpicIcon = !this.isshowpicIcon
      
        },
    returnTap() {
      this.$router.go(-1);
    },
    showpublish() {
      this.$router.push("/renwugonggaoadd");
      // this.isshowpublish = !this.isshowpublish
    },
    closemodal() {
      this.showpublish();
      console.log("我出发了");
    },
    skiptopublish() {
      this.$router.push({
        path: "/publish",
      });
    },
    skiptomylife() {
      this.$router.push({
        path: "/renwugonggaomine",
      });
    },
    formatter(type, val) {
      if (type === "year") {
        return `${val}年`;
      } else if (type === "month") {
        return `${val}月`;
      }
      return val;
    },
    confirm() {
      this.show = false;
    },
    cancel() {
      this.show = false;
    },
    chakanTap() {
      console.log(111);
      this.show = true;
    },
  },
  created() {
    var type = this.$route.query.type;
    if (type == 1) {
      this.text = "任务公告栏";
    } else {
      this.text = "财务报销";
    }
  },
};
</script>
<style  scoped>
.top_nav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  padding: 0 25px;
  font-size: 18px;
  color: #fff;
  background: #4ac7d7;
}
.return_icon {
  width: 15px;
  height: 15px;
  /* transform: rotate(180deg); */
}
.btn {
  width: 25px;
  height: 25px;
}
.top_pulish {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #5e5e5e;
  height: 150px;
  margin-bottom: 50px;
}
.camere_icon {
  width: 70px;
  height: 70px;
}
.headimg {
  position: absolute;
  right: 20px;
  bottom: -20px;
  height: 60px;
  width: 60px;
}
.name {
  position: absolute;
  right: 110px;
  bottom: 1px;
  color: #fff;
}
.top_main {
  display: flex;
  justify-content: flex-start;
  flex-direction: row;
  align-items: flex-start;
  margin-left: 20px;
  margin-right: 10px;
}
.concent {
  border-bottom: 1px solid #e3e4e5;
}
.main {
  margin: 0 20px 20px 60px;
}
.main_headimg {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}
.main_name {
  font-size: 18px;
  font-weight: 600;
  color: #5d6f95;
  margin-bottom: 10px;
}
.main_pictures {
  display: flex;
  flex-wrap: wrap;
  margin-top: 20px;
}
.main_pictures_lattice {
  width: 80px;
  height: 80px;
  margin: 0 8px 8px 0;
}
.main_adderss {
  font-size: 12px;
  color: #74839b;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main_time_moreevent {
  position: relative;
  display: flex;
  justify-content: space-between;
}
.main_moredot {
  width: 30px;
  height: 20px;
}
.main_time {
  color: #b5b5b5;
  font-size: 14px;
}
.pulish_list {
}
.comment {
  background: #f8f8f8;
  margin: 0 10px 0px 10px;
  position: relative;
  padding: 5px 0 0 0;
  top: 5px;
}
.bulge {
  position: absolute;
  top: -5px;
  left: 20px;
  border-radius: 3px;
  background: #f8f8f8;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  z-index: -1;
}
.comment_live {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 40px;
  border-bottom: 1px solid #e3e4e5;
  height: 40px;
}
.live_headimg {
  width: 30px;
  height: 30px;
  margin: 0 5px 5px 0;
}
.live_icon {
  position: absolute;
  width: 18px;
  height: 18px;
  top: 10px;
  left: -30px;
}
.comment_chat {
  position: relative;
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid #e3e4e5;
  margin: 10px 0px 0px 0px;
  padding-bottom: 10px;
}
.chat_headimg {
  width: 40px;
  height: 40px;
}
.comment_main {
  width: 100%;
}
.comment_name_time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: 10px;
}
.comment_name {
  color: #5d6f95;
  font-weight: 600;
}
.comment_time {
  color: #7b7b7b;
  font-size: 12px;
}
.comment_text {
  margin-left: 10px;
}
.chat_icon {
  position: absolute;
  width: 18px;
  height: 18px;
  top: 10px;
  left: -30px;
}
.input_comment {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #f8f8f8;
  height: 50px;
  border-top: 1px solid #e3e4e5;
  /* padding: 5px;
     margin: 0 10px; */
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.input_comment input {
  width: 85%;
  height: 40px;
  border: none;
  outline: none;
}
.space {
  height: 60px;
}
.look_icon {
  width: 30px;
  height: 30px;
}
.block {
  height: 145px;
  width: 100%;
  position: fixed;
  right: 0px;
  bottom: 0px;
  z-index: 100;
  background: rgba(255, 255, 255, 1);
  border-radius: 5px;
  z-index: 999;
}
.blockOne {
  height: 68px;
  width: 100%;
  text-align: center;
  line-height: 68px;
}
.block1 {
  border-bottom: 5px solid #bebebe;
  color: red;
}
.pic_icon{
    position: absolute;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    top: -5px;
    right: 40px;
    width: 150px;
    height: 30px;
    background: #333333;
    border-radius: 5px;
}
.pic_icon span{
    margin-left: 10px;
}
.low{
    width: 1px;
    height: 20px;
    background: #000;
    margin: 0 10px;
}
</style>